<template>
<div>
    <h1>首页</h1>
    <input v-model="message">
</div>
</template>

<script>
import { mapState, mapGetters, mapMutations, mapActions  } from "vuex";
export default {
	components: {
	},
	data () {
		return {
		};
	},
	mounted () {
		this.increment({
			name:'hahah',
			bbb:9870
		});
		console.log(this, 'doneCount');
	},
	methods: {
		...mapMutations({
			setName:"SET_NAME"
		}),
		...mapActions({
			increment:"increment"
		})
	},
	computed: {
		...mapState({
			user: store=>store.getters.name
		}),
		...mapGetters({
			doneCount: 'name'
		}),
		message: {
			get () {
				return this.$store.state.user.avatar;
			},
			set (value) {
				this.$store.commit('SET_AVATAR', value);
			}
		}
	}
};
</script>

<style lang="scss" scoped>

</style>
